package com.self.baseutile.Utile;

import android.app.Activity;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.self.baseutile.R;

/**
 * Craeted by: huangdx
 * Date : 2021/3/2
 * Describe :
 */
public class ImageLoaderUtil {

    private static  RequestOptions options = null;

    private ImageLoaderUtil() {
         options = new RequestOptions()
                .centerCrop()
                 .skipMemoryCache(true)
                .placeholder(R.mipmap.default_image)
                .error(R.mipmap.default_image)
                 .circleCropTransform()
                .priority(Priority.HIGH);
    }

    public static  void LoadUrl(String url, Activity activity, ImageView imageView){
        if(options==null){
            new ImageLoaderUtil();
        }
        Glide.with(activity).load(url) .apply(options).into(imageView);
    }

}
